; (function (window, undefined) {
    var Wheel = function (obj) {
        var that = this;
        var browser = window.navigator.userAgent.toLowerCase().indexOf("firefox");
        this.direct = null;
        if (browser > -1) {
            this.addEvent(obj, "DOMMouseScroll", function (e) {
                e = e || window.event;
                that.direct = e.detail;
                that.handle(obj, this.direct);
            }, false);
        } else {
            this.addEvent(obj, "mousewheel", function (e) {
                e = e || window.event;
                that.direct = e.wheelDelta;
                that.handle(obj, that.direct);
            }, false);
        }
    }

    Wheel.prototype.addEvent = function (obj, event, fn, bubble) {
        if (obj.attachEvent) {
            obj.attachEvent("on" + event, fn);
        } else {
            bubble == undefined ? false : bubble;
            obj.addEventListener(event, fn, bubble);
        }
    };

    Wheel.prototype.handle = function (obj, direct) {
        console.log(obj.clientHeight);

        if (direct < 0) {
            obj.scrollTop = window.screen.availHeight + obj.scrollTop;
        }
        else {
            obj.scrollTop = -window.screen.availHeight + obj.scrollTop;
        }
    };

    Wheel.prototype.init = function () {
    };

    window["Wheel"] = Wheel;

})(window)